package com.vhly.tuite.controller;

import android.graphics.Bitmap;

import java.util.Hashtable;

/**
 * Created by IntelliJ IDEA.
 * User: vhly
 * Date: 2010-9-1
 * Time: 14:49:36
 *
 * @author vhly[FR]
 */
public class PhotoStore {
    private static PhotoStore outInstance;

    public static PhotoStore getInstance(){
        if(outInstance == null){
            outInstance = new PhotoStore();
        }
        return outInstance;
    }

    private PhotoStore(){
        images = new Hashtable<String, Bitmap>();
    }

    private Hashtable<String, Bitmap>images;

    public void putImage(String url, Bitmap img){
        images.put(url,img);
    }

    public Bitmap getImage(String url){
        Bitmap ret = null;
        if(url != null){
            if(images.containsKey(url)){
                ret = images.get(url);
            }
        }
        return ret;
    }
}
